<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>

<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
    select * from modulos
    where id_curso=?
    order by desc_modulo
    <sql:param value="${param.id_curso}"/>
</sql:query>
<c:choose>
    <c:when test="${!empty query.rows}">
        <label class="lbInput">Módulo<em>*</em></label>
        <select name="id_modulo" class="required" onchange="getComponentes()">
            <option value="">Selecione um módulo</option>
            <c:forEach var="row" items="${query.rows}">
                <option value="${row.id_modulo}" ${row.id_modulo==param.id_modulo?'selected':''}>${row.desc_modulo}</option>
            </c:forEach>
        </select>
    </c:when>
    <c:otherwise>
        <p style="font-size: 12pt; color: red">Nenhum módulo foi encontrado.</p>
    </c:otherwise>
</c:choose>